/* eslint-disable @typescript-eslint/prefer-function-type */
// define global
declare const __container__: import("inversify").Container | null;
declare type ClassDecorator2 = <TFunction extends NewableFunction>(
  target: TFunction,
) => TFunction | void;

interface NewableFunction {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  new (...args: any[]): any;
}

/**
 * @decorator
 * @param identifier
 * @param _uniqId
 * @returns
 */
export function AutoBind(
  identifier?: symbol,
  _uniqId?: string,
): ClassDecorator2 {
  return (target) => {
    if (identifier) {
      __container__?.bind(identifier).to(target);
    } else {
      __container__?.bind(target).toSelf();
    }
  };
}
